﻿using System;
using System.Collections.Generic;

namespace YJKStatisticTable.AreaTable.StatisticControler
{
	public class HouseSuiteAreaAnalyzeRowData
	{
		public HouseSuiteAreaAnalyzeRowData(HouseSuiteAreaAnalyzeRowData rhs)
		{
			this.m_SuiteNumbName = rhs.m_SuiteNumbName;
			this.m_SuiteUseArea = rhs.m_SuiteUseArea;
			this.m_BalconyArea = rhs.m_BalconyArea;
			this.m_SuiteArchArea = rhs.m_SuiteArchArea;
			this.m_PublicArea = rhs.m_PublicArea;
			this.m_SuiteCount = rhs.m_SuiteCount;
			this.m_SumSuiteArchArea = rhs.m_SumSuiteArchArea;
			this.m_SumSuiteRate = rhs.m_SumSuiteRate;
		}

		public HouseSuiteAreaAnalyzeRowData(string suiteNumbName, double suiteUseArea, double publicArea, double suiteArchArea, double balconyArea, double suiteCount, double sumSuiteArchArea, double sumSuiteRate)
		{
			this.m_SuiteNumbName = suiteNumbName;
			this.m_SuiteUseArea = suiteUseArea.ToString("f2");
			this.m_BalconyArea = balconyArea.ToString("f2");
			this.m_SuiteArchArea = suiteArchArea.ToString("f2");
			this.m_PublicArea = publicArea.ToString("f2");
			this.m_SuiteCount = suiteCount.ToString("f0");
			this.m_SumSuiteArchArea = sumSuiteArchArea.ToString("f2");
			this.m_SumSuiteRate = (sumSuiteRate * 100.0).ToString("f0") + "%";
		}

		public List<string> ToStrList()
		{
			return new List<string>
			{
				this.m_SuiteNumbName,
				this.m_SuiteUseArea,
				this.m_PublicArea,
				this.m_SuiteArchArea,
				this.m_BalconyArea,
				this.m_SuiteCount,
				this.m_SumSuiteArchArea,
				this.m_SumSuiteRate
			};
		}

		public void ToGridCellList(int colIndex, ref int startRowIndex, ref List<CellInfo> cells)
		{
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SuiteNumbName));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SuiteUseArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_PublicArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SuiteArchArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_BalconyArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SuiteCount));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumSuiteArchArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumSuiteRate));
			startRowIndex++;
		}

		public string m_SuiteNumbName;

		public string m_SuiteUseArea;

		public string m_PublicArea;

		public string m_SuiteArchArea;

		public string m_BalconyArea;

		public string m_SuiteCount;

		public string m_SumSuiteArchArea;

		public string m_SumSuiteRate;
	}
}
